{% extends 'root.html' %}

{% block main_menu %}
<ul class="navbar-nav mr-auto">
  
  {% if request.user.is_superuser or request.user.role == 'ADMIN' or request.user.has_marketing_access %}
  <li class="nav-item"><a class="nav-link" id="marketing-dashboard" href="{% url 'marketing:dashboard' %}">Dashboard</a>
  </li>
  <li class="nav-item mt-2 contact_class" id="contact">
    <div class="btn-group">
      <button type="button" class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
        aria-expanded="false" style="box-shadow: none; color: #657b88">
        Contacts
      </button>
      <div class="dropdown-menu mt-2">
        <a class="dropdown-item contact-list" id="contact-list" href="{% url 'marketing:contact_lists' %}">Contacts
          List</a>
        
        <a class="dropdown-item contacts" id="contacts" href="{% url 'marketing:contacts_list' %}">Contacts</a>
        
      </div>
    </div>
  </li>

  
  <li class="nav-item"><a class="nav-link" id="email-templates" href="{% url 'marketing:email_template_list' %}">Email
      templates</a></li>
  <li class="nav-item"><a class="nav-link" id="campaigns" href="{% url 'marketing:campaign_list' %}">Campaigns</a></li>
  {% endif %}
  
</ul>
{% endblock %}



{% comment %}


{% extends 'root.html' %}
{% load static %}
{% load compress %}
{% load thumbnail %}
{% block main_menu %}

{% endblock %}
{% block header %}

{% endblock header %}


{% block content %}
<div class="side_menu">
  
  
  <div class="dropdown">
    <a class="dropdown-toggle navbar-brand mt-2 ml-3" href="#" role="button" id="dropdownMenuLink"
      data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
      style="color:#000; font-weight: 800; font-size: 1.5em;">
      Django <span class="green_color text-uppercase" style="color:#7ae847">Crm</span>
    </a>

    <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
      <a class="dropdown-item" href="/">Sales</a>
      <a class="dropdown-item" href="{% url 'marketing:dashboard' %}">Marketing</a>
    </div>
  </div>
  
  <div class="profile_block">
    <ul>

      <li data-toggle="tooltip" data-placement="bottom" title="{{request.user}}">
        <a href="#" class="profile_pic">
          
          {% if not request.user.profile_pic %}
          <img src="{% static 'images/user.png' %}" alt="Micro profile pic">
          {% else %}
          {% thumbnail request.user.profile_pic "25x25" as im %}
          <img src="{{ im.url }}">
          {% endthumbnail %}
          {% endif %}
        </a>
      </li>

      <li data-toggle="tooltip" data-placement="bottom" title="Users">
        <a href="{% url 'common:users_list' %}" class="sky_blue box"><i class="fas fa-users"></i>
        </a>
      </li>
      <li data-toggle="tooltip" data-placement="bottom" title="Change Password">
        <a href="{% url 'common:change_password' %}" class="red box"><i class="fas fa-key"></i></a>
      </li>
      <li data-toggle="tooltip" data-placement="bottom" title="Profile">
        <a href="{% url 'common:profile' %}" class="green box"><i class="fas fa-user"></i></a>
      </li>
      <li data-toggle="tooltip" data-placement="bottom" title="Logout">
        <a href="{% url 'common:logout' %}" class="purple box"><i class="fas fa-sign-out-alt"></i></a>
      </li>
    </ul>
  </div>
  <div class="menu_block">
    <ul class="main_menu">
      <li class="parent_menu">
        <a href="{% url 'marketing:contact_lists' %}" class="red"><i class="far fa-address-book"></i>Contacts</a>
        <ul class="submenu">
          <li><a href="{% url 'marketing:contacts_list' %}" class="yellow"><i class="fas fa-bars"></i>All Contacts</a>
          </li>
          <li><a href="{% url 'marketing:contact_list_new' %}" class="yellow"><i class="far fa-plus-square"></i>Create
              Contact</a></li>
        </ul>
      </li>
      <li class="parent_menu">
        <a href="{% url 'marketing:email_template_list' %}" class="purple"><i class="fas fa-envelope-open"></i>Email
          Templates</a>
        <ul class="submenu">
          <li><a href="{% url 'marketing:email_template_list' %}" class="d_green"><i class="fas fa-bars"></i>All
              Templates</a></li>
          <li><a href="{% url 'marketing:email_template_new' %}" class="d_green"><i
                class="far fa-plus-square"></i>Create
              Template</a></li>
        </ul>
      </li>
      <li class="parent_menu">
        <a href="{% url 'marketing:campaign_list' %}" class="green"><i class="fas fa-at"></i>Campaigns</a>
        <ul class="submenu">
          <li><a href="{% url 'marketing:campaign_list' %}" class="sky_color"><i class="fas fa-bars"></i>All
              Campaigns</a></li>
          <li><a href="{% url 'marketing:campaign_new' %}" class="sky_color"><i class="far fa-plus-square"></i>Create
              Campaign</a></li>
        </ul>
      </li>
    </ul>
  </div>
</div>

{% endblock %}

{% endcomment %}